

#ifndef GISAO_INTERFACE_H
#define GISAO_INTERFACE_H

#include <stdint.h>
#include <string>
#include "app_platform/cntl_info.h"

#include "erp/gis/po/regionpo_gis.h"	
#include <set>	
#include <map>	
#include "erp/gis/po/ipaddresspo_gis.h"	


namespace erp
{
namespace gis
{
namespace ao
{

	/// 同步调用接口
	class IGisAo	{
	public:
		virtual ~IGisAo() {}

	public:

		/**
		 *
	 	 *  根据IP获取地址信息 
		 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param Set ipList: IP列表，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param Map ipAddress: 地址信息  		
		 *@param String outReserve: 返回保留字   		
		 *
		 *@return  uint32_t : 0(成功) 其它失败
 	     *
		 */
	    virtual uint32_t GetIpAddressByIp(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const std::set<uint32_t >& ipList,
				const std::string& inReserve,
				std::string& errmsg,
				std::map<uint32_t,erp::gis::po::CIpAddressPo >& ipAddress,
				std::string& outReserve
	    	) = 0;

		/**
		 *
	 	 *  根据IP获取地区列表信息，由高到低 
		 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param Set ipList: IP列表，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param Map smallestRegion: 地址信息  		
		 *@param String outReserve: 返回保留字   		
		 *
		 *@return  uint32_t : 0(成功) 其它失败
 	     *
		 */
	    virtual uint32_t GetSmallestRegionByIp(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const std::set<uint32_t >& ipList,
				const std::string& inReserve,
				std::string& errmsg,
				std::map<uint32_t,std::vector<erp::gis::po::CRegionPo > >& smallestRegion,
				std::string& outReserve
	    	) = 0;
	};

	///异步调用接口
	class IGisAoAsyc
	{
	public:
		virtual ~IGisAoAsyc() {}
	public:
		virtual uint32_t SendGetIpAddressByIp(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const std::set<uint32_t >& ipList,
				const std::string& inReserve
				) = 0;
		virtual uint32_t RecvGetIpAddressByIp(
				const CCntlInfo& rCntlInfo,

				std::string& errmsg,
				std::map<uint32_t,erp::gis::po::CIpAddressPo >& ipAddress,
				std::string& outReserve
				) = 0;
		virtual uint32_t SendGetSmallestRegionByIp(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const std::set<uint32_t >& ipList,
				const std::string& inReserve
				) = 0;
		virtual uint32_t RecvGetSmallestRegionByIp(
				const CCntlInfo& rCntlInfo,

				std::string& errmsg,
				std::map<uint32_t,std::vector<erp::gis::po::CRegionPo > >& smallestRegion,
				std::string& outReserve
				) = 0;
	};
	
	
}
}
}

#endif /*GISAO_INTERFACE_H*/
